<template>
  <div >
    {{ this.$store.state.cityName }}
    {{cityName}}
    <button @click="btn('北京')">按钮</button>
    {{datas}}
    <HomeViewVue></HomeViewVue>
  </div>
</template>
<script>
import { mapState ,mapMutations} from "vuex";
import HomeViewVue from "./views/HomeView.vue";
export default{
  // computed:mapState(['cityName'])
  computed:{
    datas(){
      return 123;
    },
    ...mapState(['cityName'])
  },
  methods:{
    btn(cName){
      console.log(this.changeStr);
      this.changeStr(cName);
    },
    ...mapMutations(['changeStr'])
  },
  components:{
    HomeViewVue
  }
}
</script>

